Skip to contentSkip to conversation

Change in openvpn[master]: iservice: handle ignoring itf domains correctly

Openvpn-devel In review d12fk (Code Review) 2 participants 6 messages Nov 23, 2025 – Nov 26, 2025 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1763880426000.I02e2c7b27b5a39b11556e4753c648baa05344ffc@...2715...

#1 lore raw

Attention is currently required from: plaisthos.

Hello plaisthos,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1394?usp=email

to review the following change.

Change subject: iservice: handle ignoring itf domains correctly
......................................................................

iservice: handle ignoring itf domains correctly

GetItfDnsDomains() does ignore domains, which are in the search domains list. Handling of this was done wrong if there was more than one interface domain. In any case the size returned to the caller was calculated wrong.

Change-Id I02e2c7b27b5a39b11556e4753c648baa05344ffc

---
M src/openvpnserv/interactive.c

1 file changed, 4 insertions(+), 2 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/94/1394/1

src/openvpnserv/interactive.c +4 -2
index 006f748..8916bea 100644
@@ -2190,14 +2190,16 @@
                 {
                     if (comma)
                     {
-                        pos = comma + 1;
+                        /* Overwrite the ignored domain with remaining one(s) */
+                        memmove(pos, comma + 1, buf_size - converted_size);
+                        *size -= domain_size + one_glyph;
                         continue;
                     }
                     else
                     {
                         /* This was the last domain */
                         *pos = '\0';
-                        *size += one_glyph;
+                        *size -= domain_size;
                         return wcslen(domains) ? NO_ERROR : ERROR_FILE_NOT_FOUND;
                     }
                 }

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1394?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I02e2c7b27b5a39b11556e4753c648baa05344ffc
Gerrit-Change-Number: 1394
Gerrit-PatchSet: 1
Gerrit-Owner: d12fk <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: d12fk, plaisthos.

cron2 has posted comments on this change by d12fk. ( http://gerrit.openvpn.net/c/openvpn/+/1394?usp=email )

Change subject: iservice: handle ignoring itf domains correctly
......................................................................

Patch Set 3: Code-Review+2

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1394?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I02e2c7b27b5a39b11556e4753c648baa05344ffc
Gerrit-Change-Number: 1394
Gerrit-PatchSet: 3
Gerrit-Owner: d12fk <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: d12fk <[email protected]...>
Gerrit-Comment-Date: Wed, 26 Nov 2025 10:46:53 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes

#3 lore raw

PATCH v3 1/1 iservice: handle ignoring itf domains correctly

In reply to a message not in the archive

From: Heiko Hund <[email protected]...>

GetItfDnsDomains() does ignore domains, which are in the search domains list. Handling of this was done wrong if there was more than one interface domain. In any case the size returned to the caller was calculated wrong.

Change-Id I02e2c7b27b5a39b11556e4753c648baa05344ffc

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1394
---

This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1394
This mail reflects revision 3 of this Change.

Acked-by according to Gerrit (reflected above):
Gert Doering <[email protected]...>

src/openvpnserv/interactive.c +4 -2
index 5fb7f2b..31a7ffa 100644
@@ -2190,14 +2190,16 @@
                 {
                     if (comma)
                     {
-                        pos = comma + 1;
+                        /* Overwrite the ignored domain with remaining one(s) */
+                        memmove(pos, comma + 1, buf_size - converted_size);
+                        *size -= domain_size + one_glyph;
                         continue;
                     }
                     else
                     {
                         /* This was the last domain */
                         *pos = '\0';
-                        *size += one_glyph;
+                        *size -= domain_size;
                         return wcslen(domains) ? NO_ERROR : ERROR_FILE_NOT_FOUND;
                     }
                 }
#4 lore raw

[Openvpn-devel] [PATCH applied] Re: iservice: handle ignoring itf domains correctly

This looks reasonable (and was one of the things I wondered about in reviewing the first 5 single-line patches near to it - "this cannot work at all?"). BB says it compiles. We have no unit or other systematic tests for this, which - quite obviously - needs to be fixed...

Your patch has been applied to the master branch.

commit c0cb510257ac48d69c39388024beb1e75bee1893

Author: Heiko Hund
Date:   Wed Nov 26 11:47:01 2025 +0100
     iservice: handle ignoring itf domains correctly

     Signed-off-by: Heiko Hund <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1394
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg34677.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#5 lore raw
In reply to a message not in the archive

cron2 has uploaded a new patch set (#4) to the change originally created by d12fk. ( http://gerrit.openvpn.net/c/openvpn/+/1394?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by cron2

Change subject: iservice: handle ignoring itf domains correctly
......................................................................

iservice: handle ignoring itf domains correctly

GetItfDnsDomains() does ignore domains, which are in the search domains list. Handling of this was done wrong if there was more than one interface domain. In any case the size returned to the caller was calculated wrong.

Change-Id I02e2c7b27b5a39b11556e4753c648baa05344ffc

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1394
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg34677.html

---
M src/openvpnserv/interactive.c

1 file changed, 4 insertions(+), 2 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/94/1394/4

src/openvpnserv/interactive.c +4 -2
index 4a3e689..ce37ac2f 100644
@@ -2190,14 +2190,16 @@
                 {
                     if (comma)
                     {
-                        pos = comma + 1;
+                        /* Overwrite the ignored domain with remaining one(s) */
+                        memmove(pos, comma + 1, buf_size - converted_size);
+                        *size -= domain_size + one_glyph;
                         continue;
                     }
                     else
                     {
                         /* This was the last domain */
                         *pos = '\0';
-                        *size += one_glyph;
+                        *size -= domain_size;
                         return wcslen(domains) ? NO_ERROR : ERROR_FILE_NOT_FOUND;
                     }
                 }

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1394?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I02e2c7b27b5a39b11556e4753c648baa05344ffc
Gerrit-Change-Number: 1394
Gerrit-PatchSet: 4
Gerrit-Owner: d12fk <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>

#6 lore raw
In reply to a message not in the archive

cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1394?usp=email )

Change subject: iservice: handle ignoring itf domains correctly
......................................................................

iservice: handle ignoring itf domains correctly

GetItfDnsDomains() does ignore domains, which are in the search domains list. Handling of this was done wrong if there was more than one interface domain. In any case the size returned to the caller was calculated wrong.

Change-Id I02e2c7b27b5a39b11556e4753c648baa05344ffc

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1394
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg34677.html

---
M src/openvpnserv/interactive.c

1 file changed, 4 insertions(+), 2 deletions(-)
src/openvpnserv/interactive.c +4 -2
index 4a3e689..ce37ac2f 100644
@@ -2190,14 +2190,16 @@
                 {
                     if (comma)
                     {
-                        pos = comma + 1;
+                        /* Overwrite the ignored domain with remaining one(s) */
+                        memmove(pos, comma + 1, buf_size - converted_size);
+                        *size -= domain_size + one_glyph;
                         continue;
                     }
                     else
                     {
                         /* This was the last domain */
                         *pos = '\0';
-                        *size += one_glyph;
+                        *size -= domain_size;
                         return wcslen(domains) ? NO_ERROR : ERROR_FILE_NOT_FOUND;
                     }
                 }

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1394?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I02e2c7b27b5a39b11556e4753c648baa05344ffc
Gerrit-Change-Number: 1394
Gerrit-PatchSet: 4
Gerrit-Owner: d12fk <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>